#include "Die.h"
#include "RaiiDie.h"

#include <algorithm>

namespace dwarf {

RaiiDie::RaiiDie(Dwarf_Debug _debug, Dwarf_Die _die)
		: RaiiPointer<Dwarf_Die>(_debug, _die) {
}

RaiiDie::RaiiDie(Dwarf_Debug _debug)
		: RaiiPointer<Dwarf_Die>(_debug) {
}

RaiiDie::RaiiDie(const RaiiDie &_raiiDie)
		: RaiiPointer<Dwarf_Die>(_raiiDie) {
}

RaiiDie::~RaiiDie() {
}

void RaiiDie::next() {
	std::swap(pointer_, Die::getSibling(debug_, pointer_).getPointer());
}

}
